package it.unisa.beans;
import java.io.Serializable;
import java.sql.Time;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;
import javax.validation.constraints.*;

@Entity
@Table(name="Petroglyph")
public class Petroglyph {
	
	public Petroglyph() {
		super();
		
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Set<Route> getRoutes() {
		return routes;
	}
	public void setRoutes(Set<Route> routes) {
		this.routes = routes;
	}
	public Set<Photo> getPhotos() {
		return photos;
	}
	public void setPhotos(Set<Photo> photos) {
		this.photos = photos;
	}
	public Account getAccount() {
		return account;
	}
	public void setAccount(Account account) {
		this.account = account;
	}
	public int getPositionX() {
		return positionX;
	}
	public void setPositionX(int positionX) {
		this.positionX = positionX;
	}
	public int getPositionY() {
		return positionY;
	}
	public void setPositionY(int positionY) {
		this.positionY = positionY;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Time getHour() {
		return hour;
	}
	public void setHour(Time hour) {
		this.hour = hour;
	}



	@Id
	@Column(name="id")
	private int id;
	@ManyToMany(mappedBy="petroglyphs")
	private Set<Route> routes = new HashSet<Route>();	
	@OneToMany(fetch = FetchType.EAGER,mappedBy="petroglyph")
	private Set<Photo> photos=new HashSet<Photo>();
	@ManyToOne
	@JoinColumn(name="id_archeologist")
	private Account account;
	@Column(name="positionX")
	private int positionX;
	@Column(name="positionY")
	private int positionY;
	@Column(name="title")
	private String title;
	@Column(name="description")
	private String description;
	@Column(name="date")
	private Date date;
	@Column(name="hour")
	private Time hour;
	
	
	
}
